package com.manor.common.utils

import android.graphics.Color
import android.graphics.drawable.Drawable
import com.noober.background.drawable.DrawableCreator

/**
 *

 * @date  2020/10/29  15:52
 * @version 1.0
 */
object DrawableUtil {


    fun getDrawable(radius: Int, color: String): Drawable =
            DrawableCreator.Builder()
                    .setCornersRadius(DpUtil.dp2px(radius).toFloat())
                    .setSolidColor(Color.parseColor(color))
                    .build()

    fun getGradientDraw(radius: Int, startColor: String, endColor: String, angle :Int): Drawable =
            DrawableCreator.Builder()
                    .setCornersRadius(DpUtil.dp2px(radius).toFloat())
                    .setGradientColor(Color.parseColor(startColor), Color.parseColor(endColor))
                    .setGradientAngle(angle)
                    .build()


}